<style>
    .spin-cont { line-height: 35px; background-color: #ffffff; width: 600px; margin: 0 auto;}
    .showLeft { display: inline-block; width: 100px; text-align: right; }
    :focus{outline: none;}
    .input{ border: solid 1px #ccc; height:20px;padding: 4px; width: 200px;}
    .select{border: solid 1px #ccc; height:30px;padding: 4px; width: 210px; margin-left: -3px;}
    .textarea{width: 450px; height: 100px;line-height: 22px; margin-left: -3px;border: solid 1px #ccc;}
    .red{color: red;}
    .button{width: 100px;text-align: center;height: 26px;background-color: #eee; border: 1px solid #ccc;border-radius: 4px; }
</style>
<div id="main-content">
    <div id="main" class="main">
        <div class="user-hd">
            <h2>2016影院管理>>{$agentName}>>结算审核</h2>
        </div>
        <div class="spin-cont">
            <form id="BalanceAudit">
            <div>请确认是否完成本次结算</div>
            <div><span class="showLeft">影院：</span>{$agentName}</div>
            <div><span class="showLeft">结算金额：</span><input type="text" class="input" value="{$inf.money_total}" name="data[money_really]" id="money"> <span class="red">默认填写对应的结算金额，可由审核人手动修改。</span></div>
            <div>
                <span class="showLeft">结算方式：</span>
                <select class="select" name="data[payfor_type]" >
                    <volist name="payForType" id="vo">
                        <option value="{$i}">{$vo}</option>
                    </volist>
                </select>
                <span class="red">银行卡转账和现金支付两种方式可选</span>
            </div>
            <div><span class="showLeft">审核人：</span><span class="red">{$user_name}</span></div>
            <div>
                <span class="showLeft" style="vertical-align: top">备注：</span>
                <textarea class="textarea" name="data[note]"></textarea>
            </div>
            <input type="hidden" name="data[id]" value="{$inf.id}">
        </form>
        <div style="text-align: center">
            <input type="button" value="确认" class="button SaveForm">
            <input type="button" value="返回" class="button" style="margin-left: 10px;" onclick="window.history.go(-1)">
        </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        window.document.onkeydown = disableRefresh;
        function disableRefresh(evt){
            evt = (evt) ? evt : window.event;
            if (evt.keyCode) {
                if(evt.keyCode == 13){
                    return false;
                }
            }
        }

        $('.SaveForm').click(function () {
            if ($('#money').val() == "") {
                alert('结算金额不能为空！');
                $('#money').focus();
                return false;
            }
            if (!isNum($('#money').val())) {
                alert('结算金额只能是数字！');
                $('#money').focus();
                return false;
            }
            $.post("{:U('agentAudit')}", $('#BalanceAudit').serialize(), function (result) {
                if (result !== false) {
                    alertMessage(' 保存成功，页面即将自动跳转~', 1, 2);
                    delayGoToPage("{:U('agentBalance')}?id={$inf.agent_id}", 2000);
                } else {
                    alert('保存失败！请联系管理员！');
                }
            })

        })
    });

    //检查是否为正整数
    function   isNum(a)
    {
        var   reg =/^[1-9]\d*$|[\.\]]/;
        return reg.test(a);
    }
</script>